﻿<Window x:Class="DemoApp.PopupEditWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Method List"
        SizeToContent="WidthAndHeight"
        WindowStartupLocation="CenterOwner"
        x:Name="theView">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid Grid.Row="0" Grid.Column="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0"
                   Content="Language:"
                   Margin="0" />
            <ComboBox x:Name="cmbLanguage" 
                      Grid.Row="1"
                      HorizontalAlignment="Left"
                      Width="200"
                      Margin="5"
                      SelectedIndex="0">
            </ComboBox>
            <Label Grid.Row="2"
                   Content="Method Name:"
                   Margin="0" />
            <TextBox x:Name="txtMethodName" 
                     Grid.Row="3"
                     HorizontalAlignment="Left"
                     Width="200"
                     Margin="5"
                     FocusManager.FocusedElement="{Binding ElementName=txtMethodName}" />
            <Label Grid.Row="4"
                   Content="Method Code:"
                   Margin="0" />
            <TextBox x:Name="txtMethodCode" 
                     Grid.Row="5"
                     HorizontalAlignment="Left"
                     Width="200"
                     Margin="5"
                     Height="150"
                     AcceptsReturn="True"
                     TextWrapping="Wrap" />
        </Grid>
        <ListView Grid.Row ="0" Grid.Column="1" 
                  Name="lvMethodList"
                  SelectionChanged="lvMethodList_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Method Name"
                            DisplayMemberBinding="{Binding}" />
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Grid.Row="1"
                    Grid.ColumnSpan="2"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right">
            <Button x:Name="btnInsert" 
                    IsDefault="True"
                    Content="Insert Method"
                    Click="Insert_Click"
                    Margin="5"
                    Width="100"
                    Height="30" />
            <Button x:Name="btnUpdate" 
                    Content="Update Method"
                    IsEnabled="False"
                    Click="Update_Click"
                    Margin="5"
                    Width="100"
                    Height="30" />
            <Button x:Name="btnDelete" 
                    Content="Delete Method"
                    IsEnabled="False"
                    Click="Delete_Click"
                    Margin="5"
                    Width="100"
                    Height="30" />
            <Button Content="Close"
                    IsCancel="True"
                    Click="Close_Click"
                    Margin="5"
                    Width="100"
                    Height="30" />
        </StackPanel>
        
    </Grid>
</Window>
